import unittest
from htmlParser import *

class TestHtmlParser(unittest.TestCase):
    def testHtmlParser(self):   
        html_parser = htmlParser()
        html_parser.parse("<title> leo tolstoy's anna karenina </title> Happy families are all alike; every unhappy family is unhappy in its own way.")
        self.assertEqual(html_parser.body, ' Happy families are all alike; every unhappy family is unhappy in its own way.')
        self.assertEqual(html_parser.title, " leo tolstoy's anna karenina ")
    
    """
    Other methods are derived from HTMLParser so we do not test
    for those
    """
    
if __name__ == '__main__':
    suite = unittest.TestLoader().loadTestsFromTestCase(TestHtmlParser)
    unittest.TextTestRunner(verbosity=2).run(suite)